package com.csailing4cloud.csailing.redis.test.service;

import com.csailing4cloud.csailing.redis.test.entity.AirPort;
import com.csailing4cloud.csailing.redis.test.mapper.CacheTestMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Service;

@Service
public class CacheTestService {

    @Autowired
    private CacheTestMapper cacheTestMapper;

    @Cacheable(value = "cache:airport", key = "#code")
    public AirPort cacheTest(String code){
        return cacheTestMapper.getByCode(code);
    }

}
